﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Gds.Model.ConfigModel.BasicSystemInfo
{
    public class AdminModel : INotifyPropertyChanged
    {

        #region private
        private string _softWareTitle;

        #endregion 
        /// <summary>
        /// 是否服务器模式
        /// </summary>
        public bool IsServerModel { get; set; }
        /// <summary>
        /// 是否具备继电器控制
        /// </summary>
        public bool IsRelayRun { get; set; }
        /// <summary>
        /// 是否在具备服务器的情况下，通过从机直接控制声光报警器
        /// </summary>
        public bool IsClientControllRelay { get; set; }
        /// <summary>
        /// 主界面地图
        /// </summary>
        public string MainMapPath { get; set; }
        /// <summary>
        /// 软件标题
        /// </summary>
        public string SoftWareTitle
        {
            get
            {
                string mainViewTile = _softWareTitle;
                if (mainViewTile == "" || mainViewTile == null)
                {
                    _softWareTitle = "有毒和可燃气体监测系统";
                }
                return _softWareTitle;
            }
            set
            {
                _softWareTitle = value;
                OnPropertyChanged("SoftWareTitle");
            }
        }
        /// <summary>
        /// 是否具备告警确认功能
        /// </summary>
        public bool IsAlarmConfirmModel { get; set; }
        /// <summary>
        /// 是否包含 客户端，用于减轻，单一设备使用时，减少不必要的通讯操作
        /// </summary>
        public bool IsContainClient { get; set; }
        /// <summary>
        /// 是否去跟控制器通讯
        /// </summary>
        public bool IsCommunication { get; set; }
        /// <summary>
        /// 是否加载服务器数据 或者加载本地数据
        /// </summary>
        public bool IsLoadServerData { get; set; }
        /// <summary>
        /// 是否刷新数据
        /// </summary>
        public bool IsReFreash { get; set; }
        /// <summary>
        /// 是否保存日志
        /// </summary>
        public bool IsSaveLog { get; set; }
        /// <summary>
        /// 数据最大保存时间
        /// </summary>
        public int MaxSaveDataTime { get; set; }
        /// <summary>
        /// 是否自动清除历史数据
        /// </summary>
        public bool IsAutoDeleteHistory { get; set; }
        /// <summary>
        /// 是否高警才语音播报
        /// </summary>
        public bool IsVoiceOnHighAlarm { get; set; }
        /// <summary>
        /// 是否一直播报（否则关联继电器的开关）
        /// </summary>
        public bool IsSpeakForever { get; set; }
        /// <summary>
        /// 是否切换高低报显示文字
        /// </summary>
        public bool IsSwitchShowStr { get; set; }
        /// <summary>
        /// 高报显示文字
        /// </summary>
        public string HighAlarmStr { get; set; }
        /// <summary>
        /// 低报显示文字
        /// </summary>
        public string LowAlarmStr { get; set; }
        /// <summary>
        /// 是否限制告警记录保存周期
        /// </summary>
        public bool IsLimitSaveAlarmTime { get; set; }
        /// <summary>
        /// 告警记录保存周期
        /// </summary>
        public string LimitSaveAlarmTime { get; set; }
        /// <summary>
        /// 是否通过系统计算探头是否告警，不读取控制器的探头状态
        /// </summary>
        public bool IsPcCalcAlarmValue { get; set; }
        /// <summary>
        /// 是否显示电子地图， 还是显示平面图
        /// </summary>
        public bool IsShowChildAreaMap { get; set; }

        /// <summary>
        /// 是否显示最大化最小化按钮
        /// </summary>
        public bool IsShowMaxMin { get; set; }

        /// <summary>
        /// 是否包含备用服务器
        /// </summary>
        public bool IsContainBackupServer { get; set; }
        /// <summary>
        /// 备用服务器地址
        /// </summary>
        public string BackupServerIp { get; set; }

        public event PropertyChangedEventHandler PropertyChanged;
        public virtual void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}
